
<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title> - Bootstrap Table</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="favicon.ico"> 

    <link href="../css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="../css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
    <link href="../css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="../css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="../css/plugins/chosen/chosen.css" rel="stylesheet">
    <link href="../css/plugins/colorpicker/css/bootstrap-colorpicker.min.css" rel="stylesheet">
    <link href="../css/plugins/cropper/cropper.min.css" rel="stylesheet">
    <link href="../css/plugins/switchery/switchery.css" rel="stylesheet">
    <link href="../css/plugins/jasny/jasny-bootstrap.min.css" rel="stylesheet">
    <link href="../css/plugins/nouslider/jquery.nouislider.css" rel="stylesheet">
    <link href="../css/plugins/datapicker/datepicker3.css" rel="stylesheet">
    <link href="../css/plugins/ionRangeSlider/ion.rangeSlider.css" rel="stylesheet">
    <link href="../css/plugins/ionRangeSlider/ion.rangeSlider.skinFlat.css" rel="stylesheet">
    <link href="../css/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css" rel="stylesheet">
    <link href="../css/plugins/clockpicker/clockpicker.css" rel="stylesheet">
    <link href="../css/animate.css" rel="stylesheet">
    <link href="../css/style.css?v=4.1.0" rel="stylesheet">
    <link href="../css/plugins/bootstrap-editable/bootstrap-editable.css">
</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="ibox float-e-margins">   
                <div class="ibox-title">
                    <h5>应用</h5>
                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                        <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                            <i class="fa fa-wrench"></i>
                        </a>
                        <ul class="dropdown-menu dropdown-user">
                            <li><a href="#">选项1</a>
                            </li>
                            <li><a href="#">选项2</a>
                            </li>
                        </ul>
                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                </div>         
                <!-- Example Events -->
                <div class="example-wrap">
                    <div class="example">
                        <div class="btn-group hidden-xs" id="exampleTableEventsToolbar" role="group">
                            <!--<button type="button" class="btn btn-outline btn-default btn-primary" data-toggle="modal" data-target="#add-modal">-->
                                <!--<i class="glyphicon glyphicon-plus" aria-hidden="true"></i>-->
                            <!--</button>-->
                            <button type="button" class="btn btn-outline btn-default btn-primary" onclick="edit_modal()">
                                <i class="glyphicon glyphicon-edit" aria-hidden="true"></i>
                            </button>
                            <button type="button" class="btn btn-outline btn-default btn-primary"  onclick="delete_modal()">
                                <i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
                            </button>
                        </div>
                        <table id="exampleTableEvents" data-mobile-responsive="true">
                            <thead>
                                <tr>
                                    <th data-field="state" data-checkbox="true"></th>
                                    <th data-field="id">ID</th>
                                    <th data-field="title">模块名称</th>
                                    <th data-field="bag">应用名称</th>
                                    <th data-field="path">操作路径</th>
                                    <th data-field="customer">应用对象</th>
                                    <th data-field="style">模块类型</th>
                                    <th data-field="type">模块样式</th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                </div>
                <!-- End Example Events -->
            </div>
        </div>        
    </div>

    <form method="post" action="" class="form-horizontal" role="form" id="form_data2" onsubmit="return check_form()" >
    <div class="modal inmodal" id="add-modal" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content animated bounceInRight">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">关闭</span>
                    </button>
                    <i class="fa fa-laptop modal-icon"></i>
                    <h4 class="modal-title">添加</h4>
                    <small class="font-bold">这里可以显示副标题。
                </div>
                <div class="modal-body">
                    <div class="form-group">
                        <div class="col-sm-12"> 
                            <div class="col-sm-1">
                                <label id="style_id" hidden="hidden">1</label> 
                            </div>
                               
                            <label class="col-sm-2 control-label">标签:</label>    
                            <div class="col-sm-7">                                
                                <input type="text" placeholder="新模块" class="form-control" id="add_title"> 
                                <span class="help-block m-b-none">请输入模块在应用中显示的标签</span>
                            </div>                                    
                        </div> 
                        <div class="tabs-container">
                            <ul class="nav nav-tabs">
                                <li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true">开关</a>
                                </li>
                                <li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">进度</a>
                                </li>
                                <li class=""><a data-toggle="tab" href="#tab-3" aria-expanded="false">按钮</a>
                                </li>
                                <li class=""><a data-toggle="tab" href="#tab-4" aria-expanded="false">时间</a>
                                </li>                                
                                <li class=""><a data-toggle="tab" href="#tab-5" aria-expanded="false">播放</a>
                                </li>
                                <li class=""><a data-toggle="tab" href="#tab-6" aria-expanded="false">表图</a>
                                </li>
                                <li class=""><a data-toggle="tab" href="#tab-7" aria-expanded="false">对话</a>
                                </li>
                            </ul>
                            <div class="tab-content">
                                    <div id="tab-1" class="tab-pane active">
                                        <div class="panel-body">
                                            <div class="col-sm-12">
                                                <div class="form-group">
                                                    <div class="col-sm-12">
                                                        <label class="col-sm-3 control-label">应用名称</label>
                                                        <div class="col-sm-8">
                                                            <select class="form-control m-b" name="account" id="baglist1">
                                                                <option>包 1</option>
                                                                <option>包 2</option>
                                                                <option>包 3</option>
                                                                <option>包 4</option>
                                                            </select>
                                                        </div>
                                                    </div>
                                                </div>                     
                                                <div class="form-group">
                                                    <div class="col-sm-12">
                                                        <label class="col-sm-3 control-label">应用对象</label>
                                                        <div class="col-sm-8">
                                                            <select class="form-control m-b" name="account" id="cmtlist1">
                                                                <option>sql数据库</option>
                                                                <option>API</option>
                                                                <option>文件</option>
                                                                <option>应用</option>
                                                            </select>
                                                        </div>
                                                    </div>
                                                </div> 
                                                <div class="form-group">
                                                    <div class="col-sm-12">
                                                        <label class="col-sm-3 control-label">拥有开关：</label>                                    
                                                        <div class="col-sm-8">
                                                            <input type="text" placeholder="开关模块" class="form-control" id="iomname1"> 
                                                            <span class="help-block m-b-none">请输入依赖开关模块id，默认为空</span>
                                                        </div>
                                                    </div>
                                                </div> 
                                    
                                                <div class="form-group">
                                                    <div class="col-sm-12">
                                                        <label class="col-sm-3 control-label">应用路径：</label>    
                                                        <div class="col-sm-8">
                                                            <input type="text" placeholder="路径" class="form-control" id="path1"> 
                                                            <span class="help-block m-b-none">请输入依赖应用或文件的路径</span>
                                                        </div>
                                                    </div>
                                                </div> 
                                            </div>
                                            <div class="col-sm-12">                                           
                                                <div class="form-group">
                                                    <div class="row">
                                                        <div class="col-sm-12">                                    
                                                            <div class="col-sm-11"> 
                                                                <div class="">
                                                                    <a onclick="fnClickAddRow(1);" href="javascript:void(0);" class="btn btn-primary ">添加行</a>
                                                                </div>
                                                                <table class="table table-striped table-bordered table-hover " id="editable1">
                                                                    <thead>
                                                                        <tr>
                                                                            <th>传递指令</th>
                                                                            <th>运行指令</th>
                                                                            <th>触发动作</th>
                                                                        </tr>
                                                                    </thead>
                                                                    <tbody>
                                                                        <tr class="gradeX">
                                                                            <td>
                                                                                <a href="#" id="iocmdkey1" data-type="text" data-title="设置键">设置键</a>
                                                                            </td>
                                                                            <td>
                                                                                <a href="#" id="iocmdval1" data-type="text" data-title="设置值">设置值</a>
                                                                            </td>
                                                                            <td>
                                                                                <a href="#" id="iocmdact1">
                                                                                    选择动作
                                                                                </a>
                                                                            </td>
                                                                        </tr>
                                                                    </tbody>
                                                                </table>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-sm-12 col-sm-offset-6" hidden="hidden">
                                                <button class="btn btn-primary" type="submit">保存</button>
                                                <button class="btn btn-white" type="submit">取消</button>
                                            </div>
                                        </div>
                                    </div>
                                    <div id="tab-2" class="tab-pane">
                                        <div class="panel-body">
                                            <div class="col-sm-12">
                                                <div class="form-group">
                                                    <div class="col-sm-12">
                                                        <label class="col-sm-3 control-label">应用名称</label>
                                                        <div class="col-sm-8">
                                                            <select class="form-control m-b" name="account" id='baglist2'>
                                                                <option>包 1</option>
                                                                <option>包 2</option>
                                                                <option>包 3</option>
                                                                <option>包 4</option>
                                                            </select>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <div class="col-sm-12">
                                                        <label class="col-sm-3 control-label">模块样式</label>
                                                        <div class="col-sm-8">
                                                            <select class="form-control m-b" name="account" id='typelist2'>
                                                                <option>滑动条</option>
                                                                <option>进度条</option>
                                                            </select>
                                                        </div>
                                                    </div>
                                                </div>                     
                                                <div class="form-group">
                                                    <div class="col-sm-12">
                                                        <label class="col-sm-3 control-label">应用对象</label>
                                                        <div class="col-sm-8">
                                                            <select class="form-control m-b" name="account" id="cmtlist2">
                                                                <option>sql数据库</option>
                                                                <option>API</option>
                                                                <option>文件</option>
                                                                <option>应用</option>
                                                            </select>
                                                        </div>
                                                    </div>
                                                </div> 
                                                <div class="form-group">
                                                    <div class="col-sm-12">
                                                        <label class="col-sm-3 control-label">拥有开关：</label>                                    
                                                        <div class="col-sm-8">
                                                            <input type="email" placeholder="开关模块" class="form-control" id="iomname2"> 
                                                            <span class="help-block m-b-none">请输入依赖开关模块，默认为空</span>
                                                        </div>
                                            
                                                        
                                                    </div>
                                                </div> 
                                            
                                                <div class="form-group">
                                                    <div class="col-sm-12">
                                                        <label class="col-sm-3 control-label">应用路径：</label>    
                                                        <div class="col-sm-8">
                                                            <input type="email" placeholder="路径" class="form-control" id="path2"> 
                                                            <span class="help-block m-b-none">请输入依赖应用或文件的路径</span>
                                                        </div>
                                                    </div>
                                                </div> 
                                            </div>
                                            <div class="col-sm-12">                                           
                                                <div class="form-group">
                                                    <div class="row">
                                                        <div class="col-sm-12">                                        
                                                            <div class="col-sm-11"> 
                                                                <div class="">
                                                                    <a onclick="fnClickAddRow(2);" href="javascript:void(0);" class="btn btn-primary ">添加行</a>
                                                                </div>
                                                                <table class="table table-striped table-bordered table-hover " id="editable2">
                                                                    <thead>
                                                                        <tr>
                                                                            <th>传递指令</th>
                                                                            <th>运行指令</th>
                                                                            <th>触发动作</th>
                                                                        </tr>
                                                                    </thead>
                                                                    <tbody>
                                                                        <tr class="gradeX">
                                                                            <td>
                                                                                <a href="#" id="sldcmdkey1" data-type="text" data-title="设置键">设置键</a>
                                                                            </td>
                                                                            <td>
                                                                                <a href="#" id="sldcmdval1" data-type="text" data-title="设置值">设置值</a>
                                                                            </td>
                                                                                <a href="#" id="sldcmdact1">选择动作
                                                                                </a>      
                                                                            </td>
                                                                        </tr>
                                                                    </tbody>
                                                                </table>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-sm-12 col-sm-offset-6" hidden="hidden">
                                                <button class="btn btn-primary" type="submit">保存</button>
                                                <button class="btn btn-white" type="submit">取消</button>
                                            </div>
                                        </div>
                                    </div>
                                    <div id="tab-3" class="tab-pane">
                                        <div class="panel-body">
                                            <div class="col-sm-12">
                                                <div class="form-group">
                                                    <div class="col-sm-12">
                                                        <label class="col-sm-3 control-label">应用名称</label>
                                                        <div class="col-sm-8">
                                                            <select class="form-control m-b" name="account" id="baglist3">
                                                                <option>包 1</option>
                                                                <option>包 2</option>
                                                                <option>包 3</option>
                                                                <option>包 4</option>
                                                            </select>
                                                        </div>
                                                    </div>
                                                </div>
                                                                    
                                                <div class="form-group">
                                                    <div class="col-sm-12">
                                                        <label class="col-sm-3 control-label">应用对象</label>
                                                        <div class="col-sm-8">
                                                            <select class="form-control m-b" name="account" id="cmtlist3">
                                                                <option>sql数据库</option>
                                                                <option>API</option>
                                                                <option>文件</option>
                                                                <option>应用</option>
                                                            </select>
                                                        </div>
                                                    </div>
                                                </div> 
                                                <div class="form-group">
                                                    <div class="col-sm-12">
                                                        <label class="col-sm-3 control-label">拥有开关：</label>                                    
                                                        <div class="col-sm-8">
                                                            <input type="email" placeholder="开关模块" class="form-control" id="iomname3"> 
                                                            <span class="help-block m-b-none">请输入依赖开关模块，默认为空</span>
                                                        </div>
                                                    </div>
                                                </div> 
                                            
                                                <div class="form-group">
                                                    <div class="col-sm-12">
                                                        <label class="col-sm-3 control-label">应用路径：</label>    
                                                        <div class="col-sm-8">
                                                            <input type="email" placeholder="路径" class="form-control" id="path3"> 
                                                            <span class="help-block m-b-none">请输入依赖应用或文件的路径</span>
                                                        </div>
                                                    </div>
                                                </div> 
                                            </div>
                                            <div class="col-sm-12">                                           
                                                <div class="form-group">
                                                    <div class="row">
                                                        <div class="col-sm-12">                                        
                                                            <div class="col-sm-11"> 
                                                                <div class="">
                                                                    <a onclick="fnClickAddRow(3);" href="javascript:void(0);" class="btn btn-primary ">添加行</a>
                                                                </div>
                                                                <table class="table table-striped table-bordered table-hover " id="editable3">
                                                                    <thead>
                                                                        <tr>
                                                                            <th>传递指令</th>
                                                                            <th>运行指令</th>
                                                                            <th>触发动作</th>
                                                                        </tr>
                                                                    </thead>
                                                                    <tbody>
                                                                        <tr class="gradeX">
                                                                            <td>
                                                                                <a href="#" id="btncmdkey1" data-type="text" data-title="设置键">设置键</a>
                                                                            </td>
                                                                            <td>
                                                                                <a href="#" id="btncmdval1" data-type="text" data-title="设置值">设置值</a>
                                                                            </td>
                                                                            <td>
                                                                                <a href="#" id="btnmdact1">
                                                                                    选择动作
                                                                                </a>
                                                                            </td>
                                                                        </tr>
                                                                        
                                                                    </tbody>
                                                                    
                                                                </table>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-sm-12 col-sm-offset-6" hidden="hidden">
                                                <button class="btn btn-primary" type="submit">保存</button>
                                                <button class="btn btn-white" type="submit">取消</button>
                                            </div>
                                        </div>
                                    </div>
                                    <div id="tab-4" class="tab-pane">
                                        <div class="panel-body">
                                            <div class="col-sm-12">
                                                <div class="form-group">
                                                            <div class="col-sm-12">
                                                                <label class="col-sm-3 control-label">应用名称</label>
                                                                <div class="col-sm-8">
                                                                    <select class="form-control m-b" name="account" id="baglist7">
                                                                        <option>包 1</option>
                                                                        <option>包 2</option>
                                                                        <option>包 3</option>
                                                                        <option>包 4</option>
                                                                    </select>
                                                                </div>
                                                            </div>
                                                </div>
                                                <div class="form-group">
                                                            <div class="col-sm-12">
                                                                <label class="col-sm-3 control-label">模块类型</label>
                                                                <div class="col-sm-8">
                                                                    <select class="form-control m-b" name="account" id="typelist7">
                                                                        <option>定时器</option>
                                                                        <option>闹钟</option>
                                                                        <option>计时器</option>
                                                                    </select>
                                                                </div>
                                                            </div>
                                                </div>                     
                                                <div class="form-group">
                                                        <div class="col-sm-12">
                                                            <label class="col-sm-3 control-label">应用对象</label>
                                                            <div class="col-sm-8">
                                                                <select class="form-control m-b" name="account" id="cmtlist7">
                                                                    <option>sql数据库</option>
                                                                    <option>API</option>
                                                                    <option>文件</option>
                                                                    <option>应用</option>
                                                                </select>
                                                            </div>
                                                        </div>
                                                </div> 
                                                <div class="form-group">
                                                        <div class="col-sm-12">
                                                            <label class="col-sm-3 control-label">拥有开关：</label>                                    
                                                            <div class="col-sm-8">
                                                                <input type="email" placeholder="开关模块" class="form-control" id="iomname7"> 
                                                                <span class="help-block m-b-none">请输入依赖开关模块，默认为空</span>
                                                            </div>
                                                
                                                            
                                                        </div>
                                                </div> 
                                                
                                                <div class="form-group">
                                                    <div class="col-sm-12">
                                                        <label class="col-sm-3 control-label">应用路径：</label>    
                                                        <div class="col-sm-8">
                                                            <input type="email" placeholder="路径" class="form-control" id="path7"> 
                                                            <span class="help-block m-b-none">请输入依赖应用或文件的路径</span>
                                                        </div>
                                                    </div>
                                                </div> 
                                            </div>
                                            <div class="col-sm-12">                                           
                                                <div class="form-group">
                                                    <div class="row">
                                                        <div class="col-sm-12">                                        
                                                                <div class="col-sm-11"> 
                                                                    <div class="">
                                                                        <a onclick="fnClickAddRow(7);" href="javascript:void(0);" class="btn btn-primary ">添加行</a>
                                                                    </div>
                                                                    <table class="table table-striped table-bordered table-hover " id="editable7">
                                                                        <thead>
                                                                            <tr>
                                                                                <th>传递指令</th>
                                                                                <th>运行指令</th>
                                                                                <th>触发动作</th>
                                                                            </tr>
                                                                        </thead>
                                                                        <tbody>
                                                                            <tr class="gradeX">
                                                                                <td>
                                                                                    <a href="#" id="timcmdkey1" data-type="text" data-title="设置键">设置键</a>
                                                                                </td>
                                                                                <td>
                                                                                    <a href="#" id="timcmdval1" data-type="text" data-title="设置值">设置值</a>
                                                                                </td>
                                                                                <td>
                                                                                    <a href="#" id="timcmdact1">
                                                                                        选择动作
                                                                                    </a>
                                                                                </td>
                                                                            </tr>
                                                                            
                                                                        </tbody>
                                                                        
                                                                    </table>
                                                                </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-sm-12 col-sm-offset-6" hidden="hidden">
                                                <button class="btn btn-primary" type="submit">保存</button>
                                                <button class="btn btn-white" type="submit">取消</button>
                                            </div>
                                        </div>
                                    </div>
                                    <div id="tab-5" class="tab-pane">
                                        <div class="panel-body">
                                            <div class="col-sm-12">
                                                <div class="form-group">
                                                            <div class="col-sm-12">
                                                                <label class="col-sm-3 control-label">应用名称</label>
                                                                <div class="col-sm-8">
                                                                    <select class="form-control m-b" name="account" id="baglist5">
                                                                        <option>包 1</option>
                                                                        <option>包 2</option>
                                                                        <option>包 3</option>
                                                                        <option>包 4</option>
                                                                    </select>
                                                                </div>
                                                            </div>
                                                </div>
                                                <div class="form-group">
                                                            <div class="col-sm-12">
                                                                <label class="col-sm-3 control-label">模块类型</label>
                                                                <div class="col-sm-8">
                                                                    <select class="form-control m-b" name="account" id=typelist5>
                                                                        <option>本地音乐</option>
                                                                        <option>本地视频</option>
                                                                        <option>远程音乐</option>
                                                                        <option>远程视频</option>
                                                                    </select>
                                                                </div>
                                                            </div>
                                                </div>                     
                                                <div class="form-group">
                                                        <div class="col-sm-12">
                                                            <label class="col-sm-3 control-label">应用对象</label>
                                                            <div class="col-sm-8">
                                                                <select class="form-control m-b" name="account" id="cmtlist5">
                                                                    <option>sql数据库</option>
                                                                    <option>API</option>
                                                                    <option>文件</option>
                                                                    <option>应用</option>
                                                                </select>
                                                            </div>
                                                        </div>
                                                </div> 
                                                <div class="form-group">
                                                        <div class="col-sm-12">
                                                            <label class="col-sm-3 control-label">拥有开关：</label>                                    
                                                            <div class="col-sm-8">
                                                                <input type="email" placeholder="开关模块" class="form-control" id="iomname5"> 
                                                                <span class="help-block m-b-none">请输入依赖开关模块，默认为空</span>
                                                            </div>
                                                
                                                            
                                                        </div>
                                                </div> 
                                                
                                                <div class="form-group">
                                                    <div class="col-sm-12">
                                                        <label class="col-sm-3 control-label">应用路径：</label>    
                                                        <div class="col-sm-8">
                                                            <input type="email" placeholder="路径" class="form-control" id="path5"> 
                                                            <span class="help-block m-b-none">请输入依赖应用或文件的路径</span>
                                                        </div>
                                                    </div>
                                                </div> 
                                            </div>
                                            <div class="col-sm-12">                                           
                                                <div class="form-group">
                                                    <div class="row">
                                                        <div class="col-sm-12">                                    
                                                            <div class="col-sm-11"> 
                                                                <div class="">
                                                                    <a onclick="fnClickAddRow(5);" href="javascript:void(0);" class="btn btn-primary ">添加行</a>
                                                                </div>
                                                                <table class="table table-striped table-bordered table-hover " id="editable5">
                                                                    <thead>
                                                                        <tr>
                                                                            <th>传递指令</th>
                                                                            <th>运行指令</th>
                                                                            <th>触发动作</th>
                                                                        </tr>
                                                                    </thead>
                                                                    <tbody>
                                                                        <tr class="gradeX">
                                                                            <td>
                                                                                <a href="#" id="plycmdkey1" data-type="text" data-title="设置键">设置键</a>
                                                                            </td>
                                                                            <td>
                                                                                <a href="#" id="plycmdval1" data-type="text" data-title="设置值">设置值</a>
                                                                            </td>
                                                                            <td>
                                                                                <a href="#" id="plycmdact1">
                                                                                    选择动作
                                                                                </a>
                                                                            </td>
                                                                        </tr>
                                                                        
                                                                    </tbody>
                                                                    
                                                                </table>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-sm-12 col-sm-offset-6" hidden="hidden">
                                                <button class="btn btn-primary" type="submit">保存</button>
                                                <button class="btn btn-white" type="submit">取消</button>
                                            </div>
                                        </div>
                                    </div>
                                    <div id="tab-6" class="tab-pane">
                                        <div class="panel-body">
                                            <div class="col-sm-12">
                                                <div class="form-group">
                                                            <div class="col-sm-12">
                                                                <label class="col-sm-3 control-label">应用名称</label>
                                                                <div class="col-sm-8">
                                                                    <select class="form-control m-b" name="account" id="baglist6">
                                                                        <option>包 1</option>
                                                                        <option>包 2</option>
                                                                        <option>包 3</option>
                                                                        <option>包 4</option>
                                                                    </select>
                                                                </div>
                                                            </div>
                                                </div>
                                                <div class="form-group">
                                                            <div class="col-sm-12">
                                                                <label class="col-sm-3 control-label">模块类型</label>
                                                                <div class="col-sm-8">
                                                                    <select class="form-control m-b" name="account" id="typelist6">
                                                                        <option>变限读取</option>
                                                                        <option>只读</option>
                                                                    </select>
                                                                </div>
                                                            </div>
                                                </div>                     
                                                <div class="form-group">
                                                        <div class="col-sm-12">
                                                            <label class="col-sm-3 control-label">应用对象</label>
                                                            <div class="col-sm-8">
                                                                <select class="form-control m-b" name="account" id="cmtlist6">
                                                                    <option>sql数据库</option>
                                                                    <option>API</option>
                                                                    <option>文件</option>
                                                                    <option>应用</option>
                                                                </select>
                                                            </div>
                                                        </div>
                                                </div> 
                                                <div class="form-group">
                                                        <div class="col-sm-12">
                                                            <label class="col-sm-3 control-label">拥有开关：</label>                                    
                                                            <div class="col-sm-8">
                                                                <input type="email" placeholder="开关模块" class="form-control" id="iomname6"> 
                                                                <span class="help-block m-b-none">请输入依赖开关模块，默认为空</span>
                                                            </div>
                                                
                                                            
                                                        </div>
                                                </div> 
                                                
                                                <div class="form-group">
                                                    <div class="col-sm-12">
                                                        <label class="col-sm-3 control-label">应用路径：</label>    
                                                        <div class="col-sm-8">
                                                            <input type="email" placeholder="路径" class="form-control" id="path6"> 
                                                            <span class="help-block m-b-none">请输入依赖应用或文件的路径</span>
                                                        </div>
                                                    </div>
                                                </div> 
                                            </div>
                                            <div class="col-sm-12">                                           
                                                <div class="form-group">
                                                    <div class="row">
                                                        <div class="col-sm-12">                                        
                                                                <div class="col-sm-11"> 
                                                                    <div class="">
                                                                        <a onclick="fnClickAddRow(6);" href="javascript:void(0);" class="btn btn-primary ">添加行</a>
                                                                    </div>
                                                                    <table class="table table-striped table-bordered table-hover " id="editable6">
                                                                        <thead>
                                                                            <tr>
                                                                                <th>传递指令</th>
                                                                                <th>运行指令</th>
                                                                                <th>触发动作</th>
                                                                            </tr>
                                                                        </thead>
                                                                        <tbody>
                                                                            <tr class="gradeX">
                                                                                <td>
                                                                                    <a href="#" id="chtcmdkey1" data-type="text" data-title="设置键">设置键</a>
                                                                                </td>
                                                                                <td>
                                                                                    <a href="#" id="chtcmdval1" data-type="text" data-title="设置值">设置值</a>
                                                                                </td>
                                                                                <td>
                                                                                    <a href="#" id="chtcmdact1">
                                                                                        选择动作
                                                                                    </a>
                                                                                </td>
                                                                            </tr>
                                                                            
                                                                        </tbody>
                                                                        
                                                                    </table>
                                                                </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-sm-12 col-sm-offset-6" hidden="hidden">
                                                <button class="btn btn-primary" type="submit">保存</button>
                                                <button class="btn btn-white" type="submit">取消</button>
                                            </div>
                                        </div>
                                    </div>                                    
                                    <div id="tab-7" class="tab-pane">
                                        <div class="panel-body">
                                            <div class="col-sm-12">
                                                <div class="form-group">
                                                    <div class="col-sm-12">
                                                        <label class="col-sm-3 control-label">应用名称</label>
                                                        <div class="col-sm-8">
                                                            <select class="form-control m-b" name="account" id="baglist4">
                                                                <option>包 1</option>
                                                                <option>包 2</option>
                                                                <option>包 3</option>
                                                                <option>包 4</option>
                                                            </select>
                                                        </div>
                                                    </div>
                                                </div>
                                                                   
                                                <div class="form-group">
                                                    <div class="col-sm-12">
                                                        <label class="col-sm-3 control-label">应用对象</label>
                                                        <div class="col-sm-8">
                                                            <select class="form-control m-b" name="account" id="cmtlist4">
                                                                <option>sql数据库</option>
                                                                <option>API</option>
                                                                <option>文件</option>
                                                                <option>应用</option>
                                                            </select>
                                                        </div>
                                                    </div>
                                                </div> 
                                                <div class="form-group">
                                                    <div class="col-sm-12">
                                                        <label class="col-sm-3 control-label">拥有开关：</label>                                    
                                                        <div class="col-sm-8">
                                                            <input type="email" placeholder="开关模块" class="form-control" id="iomname4"> 
                                                            <span class="help-block m-b-none">请输入依赖开关模块，默认为空</span>
                                                        </div>
                                    
                                                        
                                                    </div>
                                                </div> 
                                    
                                                <div class="form-group">
                                                    <div class="col-sm-12">
                                                        <label class="col-sm-3 control-label">应用路径：</label>    
                                                        <div class="col-sm-8">
                                                            <input type="email" placeholder="路径" class="form-control" id="path4"> 
                                                            <span class="help-block m-b-none">请输入依赖应用或文件的路径</span>
                                                        </div>
                                                    </div>
                                                </div> 
                                            </div>
                                            <div class="col-sm-12">                                           
                                                    <div class="form-group">
                                                        <div class="row">
                                                            <div class="col-sm-12">                                        
                                                                    <div class="col-sm-11"> 
                                                                        <div class="">
                                                                            <a onclick="fnClickAddRow(4);" href="javascript:void(0);" class="btn btn-primary ">添加行</a>
                                                                        </div>
                                                                        <table class="table table-striped table-bordered table-hover " id="editable4">
                                                                            <thead>
                                                                                <tr>
                                                                                    <th>传递指令</th>
                                                                                    <th>运行指令</th>
                                                                                    <th>触发动作</th>
                                                                                </tr>
                                                                            </thead>
                                                                            <tbody>
                                                                                <tr class="gradeX">
                                                                                    <td>
                                                                                        <a href="#" id="takcmdkey1" data-type="text" data-title="设置键">设置键</a>
                                                                                    </td>
                                                                                    <td>
                                                                                        <a href="#" id="takcmdval1" data-type="text" data-title="设置值">设置值</a>
                                                                                    </td>
                                                                                    <td>
                                                                                        <a href="#" id="takmdact1">
                                                                                            选择动作
                                                                                        </a>
                                                                                    </td>
                                                                                </tr>
                                                                                
                                                                            </tbody>
                                                                            
                                                                        </table>
                                                                    </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                            </div>
                                            <div class="col-sm-12 col-sm-offset-6" hidden="hidden">
                                                <button class="btn btn-primary" type="submit">保存</button>
                                                <button class="btn btn-white" type="submit">取消</button>
                                            </div>
                                        </div>
                                    </div>
                            </div> 
                        </div>                                                                                                              
                    </div>
                </div> 
                <div class="modal-footer">
                    <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                    <button type="submit" class="btn btn-primary" >保存</button>
                </div>
            </div>
        </div>
    </div>
    </form>

    <form method="post" action="" class="form-horizontal" role="form" id="form_data1" enctype="multipart/form-data" onsubmit="return edit_info()" >
    <div class="modal inmodal fade" id="edit-modal" tabindex="-1" role="dialog"  aria-hidden="true">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">
                        <span aria-hidden="true">&times;</span>
                        <span class="sr-only">Close</span></button>
                    <h4 class="modal-title">编辑</h4>
                    <small class="font-bold">这里可以显示副标题。
                </div>
                <div class="modal-body">
                    <div class="form-group">
                        <div class="col-sm-12"> 
                               
                            <label class="col-sm-3 control-label">标签:</label>    
                            <div class="col-sm-8">                                
                                <input type="text" placeholder="新模块" class="form-control" id="edit_title"> 
                                <span class="help-block m-b-none">请输入模块在应用中显示的标签</span>
                            </div>
                        </div>  

                        <div class="col-sm-12"> 
                            <div class="form-group">
                                <div class="col-sm-12">
                                    <label class="col-sm-3 control-label">应用对象</label>
                                    <div class="col-sm-8">
                                        <select class="form-control m-b" name="account" id="edit_cmt">
                                            <option>sql数据库</option>
                                            <option>API</option>
                                            <option>文件</option>
                                            <option>应用</option>
                                        </select>
                                    </div>
                                </div>
                            </div> 
                        </div>
                        <div class="col-sm-12"> 
                            <div class="form-group">
                                <div class="col-sm-12">
                                    <label class="col-sm-3 control-label">拥有开关：</label>                                    
                                    <div class="col-sm-8">
                                        <input type="text" placeholder="开关模块" class="form-control" id="edit_iom"> 
                                        <span class="help-block m-b-none">请输入依赖开关模块id，默认为空</span>
                                    </div>
                                </div>
                            </div> 
                            
                            <div class="form-group">
                                <div class="col-sm-12">
                                    <label class="col-sm-3 control-label">应用路径：</label>    
                                    <div class="col-sm-8">
                                        <input type="text" placeholder="路径" class="form-control" id="edit_path"> 
                                        <span class="help-block m-b-none">请输入依赖应用或文件的路径</span>
                                    </div>
                                </div>
                            </div> 
                        </div>                                  
                    </div> 
                </div>

                <div class="modal-footer">
                    <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary">保存</button>
                </div>
            </div>
        </div>
    </div>
    </form>
    
    <form method="post" action="" class="form-horizontal" role="form" id="form_data2" onsubmit="return delete_info()" >
        <div class="modal inmodal fade" id="delete-modal" tabindex="-1" role="dialog"  aria-hidden="true">
            <div class="modal-dialog modal-sm">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                        <h4 class="modal-title">删除</h4>
                    </div>
                    <div class="modal-body">
                        <h2 id="delete_text" style="font-size:14px;">Close</h2>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                        <button type="submit" class="btn btn-primary">删除</button>
                    </div>
                </div>
            </div>
        </div>
    </form>
    

    

    <!-- 全局js -->
    <script src="../js/jquery.min.js?v=2.1.4"></script>
    <script src="../js/bootstrap.min.js?v=3.3.6"></script>

    <!-- 自定义js -->
    <script src="../js/content.js?v=1.0.0"></script>
    <script src="../js/plugins/prettyfile/bootstrap-prettyfile.js"></script>

    <!-- Chosen -->
    <script src="../js/plugins/chosen/chosen.jquery.js"></script>

    <!-- JSKnob -->
    <script src="../js/plugins/jsKnob/jquery.knob.js"></script>

    <!-- Input Mask-->
    <script src="../js/plugins/jasny/jasny-bootstrap.min.js"></script>

    <!-- Data picker -->
    <script src="../js/plugins/datapicker/bootstrap-datepicker.js"></script>

    <!-- Prettyfile -->
    <script src="../js/plugins/prettyfile/bootstrap-prettyfile.js"></script>

    <!-- NouSlider -->
    <script src="../js/plugins/nouslider/jquery.nouislider.min.js"></script>

    <!-- Switchery -->
    <script src="../js/plugins/switchery/switchery.js"></script>

    <!-- IonRangeSlider -->
    <script src="../js/plugins/ionRangeSlider/ion.rangeSlider.min.js"></script>

    <!-- iCheck -->
    <script src="../js/plugins/iCheck/icheck.min.js"></script>

    <!-- MENU -->
    <script src="../js/plugins/metisMenu/jquery.metisMenu.js"></script>

    <!-- Color picker -->
    <script src="../js/plugins/colorpicker/bootstrap-colorpicker.min.js"></script>

    <!-- Clock picker -->
    <script src="../js/plugins/clockpicker/clockpicker.js"></script>


    <!-- Bootstrap table -->
    <script src="../js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
    <script src="../js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
    <script src="../js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>



    <!-- 全局js -->
    <script src="../js/plugins/jeditable/jquery.jeditable.js"></script>

    <!-- Data Tables -->
    <script src="../js/plugins/dataTables/jquery.dataTables.js"></script>
    <script src="../js/plugins/dataTables/dataTables.bootstrap.js"></script>
    <!-- Peity -->
    <script src="../js/demo/bootstrap-table-demo.js"></script>

    <script src="../js/bootbox.min.js"></script>
    <script src="../js/plugins/bootstrap-editable/bootstrap-editable.js"></script>

    
    <script>
        var list = document.getElementsByTagName('li');  
        var lable = document.getElementById("style_id");
        for(var i=0;i<list.length;i++){  
            list[i].index=i;  
            list[i].onclick=function () {  
                //alert(this.index+1);                  //加不加1随你了！  
                lable.innerHTML = this.index-1;
            }   
        } 

        $(document).ready(function () {
            
            
            for(var i=1;i<8;i++){
                edit_enable(1,i);
            } 
                
        });


        function edit_enable(id,num) {
            if(num==1){
                var key = '#iocmdkey'+id;
                var val = '#iocmdval'+id;
                var act = '#iocmdact'+id;
                $(key).editable();
                $(val).editable();
                $(act).editable({
                    type: "select",              //编辑框的类型。支持text|textarea|select|date|checklist等
                    source: [{ value: 1, text: "打开" }, { value: 2, text: "关闭" }, {value:3,text:"删除"}, {value:4,text:"停用"}],
                    title: "选择动作",           //编辑框的标题
                    disabled: false,           //是否禁用编辑
                    emptytext: "空文本",       //空值的默认文本
                    mode: "popup",            //编辑框的模式：支持popup和inline两种模式，默认是popup
                    validate: function (value) { //字段验证
                        if (!$.trim(value)) {
                            return '不能为空';
                        }
                    }
                });
            }else if(num==2){
                var key = '#sldcmdkey'+id;
                var val = '#sldcmdval'+id;
                var act = '#sldcmdact'+id;
                $(key).editable();
                $(val).editable();
                $(act).editable({
                    type: "select",              //编辑框的类型。支持text|textarea|select|date|checklist等
                    source: [{ value: 1, text: "读取" }, { value: 2, text: "拖动" }, {value:3,text:"删除"}, {value:4,text:"停用"}],
                    title: "选择动作",           //编辑框的标题
                    disabled: false,           //是否禁用编辑
                    emptytext: "空文本",       //空值的默认文本
                    mode: "popup",            //编辑框的模式：支持popup和inline两种模式，默认是popup
                    validate: function (value) { //字段验证
                        if (!$.trim(value)) {
                            return '不能为空';
                        }
                    }
                });
            }
                else if(num==3){
                var key = '#btncmdkey'+id;
                var val = '#btncmdval'+id;
                var act = '#btncmdact'+id;
                $(key).editable();
                $(val).editable();
                $(act).editable({
                    type: "select",              //编辑框的类型。支持text|textarea|select|date|checklist等
                    source: [{ value: 1, text: "点击" }, {value:2,text:"删除"}, {value:3,text:"停用"}],
                    title: "选择动作",           //编辑框的标题
                    disabled: false,           //是否禁用编辑
                    emptytext: "空文本",       //空值的默认文本
                    mode: "popup",            //编辑框的模式：支持popup和inline两种模式，默认是popup
                    validate: function (value) { //字段验证
                        if (!$.trim(value)) {
                            return '不能为空';
                        }
                    }
                });
            }else if(num==7){
                var key = '#takcmdkey'+id;
                var val = '#takcmdval'+id;
                var act = '#takcmdact'+id;
                $(key).editable();
                $(val).editable();
                $(act).editable({
                    type: "select",              //编辑框的类型。支持text|textarea|select|date|checklist等
                    source: [{ value: 1, text: "发送" }, { value: 2, text: "读取" }, {value:3,text:"删除"}, {value:4,text:"停用"}],
                    title: "选择动作",           //编辑框的标题
                    disabled: false,           //是否禁用编辑
                    emptytext: "空文本",       //空值的默认文本
                    mode: "popup",            //编辑框的模式：支持popup和inline两种模式，默认是popup
                    validate: function (value) { //字段验证
                        if (!$.trim(value)) {
                            return '不能为空';
                        }
                    }
                });
            }else if(num==5){
                var key = '#plycmdkey'+id;
                var val = '#plycmdval'+id;
                var act = '#plycmdact'+id;
                $(key).editable();
                $(val).editable();
                $(act).editable({
                    type: "select",              //编辑框的类型。支持text|textarea|select|date|checklist等
                    source: [{ value: 1, text: "播放" },{ value: 2, text: "暂停" },{value:3,text:"停止"},{value:4,text:"音量加"},{ value: 5, text: "音量减" }, { value: 6, text: "随机播放" }, {value:7,text:"循环播放"},{value:8,text:"上一曲"}, { value: 9, text: "下一曲" }, {value:10,text:"删除"}, {value:11,text:"停用"}],
                    title: "选择动作",           //编辑框的标题
                    disabled: false,           //是否禁用编辑
                    emptytext: "空文本",       //空值的默认文本
                    mode: "popup",            //编辑框的模式：支持popup和inline两种模式，默认是popup
                    validate: function (value) { //字段验证
                        if (!$.trim(value)) {
                            return '不能为空';
                        }
                    }
                });
            }else if(num==6){
                var key = '#chtcmdkey'+id;
                var val = '#chtcmdval'+id;
                var act = '#chtcmdact'+id;
                $(key).editable();
                $(val).editable();
                $(act).editable({
                    type: "select",              //编辑框的类型。支持text|textarea|select|date|checklist等
                    source: [{ value: 1, text: "读取" }, { value: 2, text: "增加" }, {value:3,text:"减少"}, {value:4,text:"删除"}, {value:5,text:"停用"}],
                    title: "选择动作",           //编辑框的标题
                    disabled: false,           //是否禁用编辑
                    emptytext: "空文本",       //空值的默认文本
                    mode: "popup",            //编辑框的模式：支持popup和inline两种模式，默认是popup
                    validate: function (value) { //字段验证
                        if (!$.trim(value)) {
                            return '不能为空';
                        }
                    }
                });
            }else if(num==4){
                var key = '#timcmdkey'+id;
                var val = '#timcmdval'+id;
                var act = '#timcmdact'+id;
                $(key).editable();
                $(val).editable();
                $(act).editable({
                    type: "select",              //编辑框的类型。支持text|textarea|select|date|checklist等
                    source: [{ value: 1, text: "开启" }, { value: 2, text: "执行" }, {value:3,text:"删除"}, {value:4,text:"停用"}],
                    title: "选择动作",           //编辑框的标题
                    disabled: false,           //是否禁用编辑
                    emptytext: "空文本",       //空值的默认文本
                    mode: "popup",            //编辑框的模式：支持popup和inline两种模式，默认是popup
                    validate: function (value) { //字段验证
                        if (!$.trim(value)) {
                            return '不能为空';
                        }
                    }
                });
            }
        }
       

    
        function fnClickAddRow(num) {
            if(num == 1){
                var id = ($('#editable1').find("tr").length+1);
                $('#editable1').dataTable().fnAddData([
                "<a href='#' id='iocmdkey" +id+ "'data-type='text' data-title='设置键'>设置键</a>",
                "<a href='#' id='iocmdval" +id+ "'data-type='text' data-title='设置值'>设置值</a>",
                "<a href='#' id='iocmdact" +id+ "'>选择动作</a>"
                ]);
                edit_enable(id,1);
            }
            else if(num == 2){
                var id = ($('#editable2').find("tr").length+1);
                $('#editable2').dataTable().fnAddData([
                "<a href='#' id='sldcmdkey" +id+ "'data-type='text' data-title='设置键'>设置键</a>",
                "<a href='#' id='sldcmdval" +id+ "'data-type='text' data-title='设置值'>设置值</a>",
                "<a href='#' id='sldcmdact" +id+ "'>选择动作</a>"
                ]);
                edit_enable(id,2);
            }
            else if(num == 3){
                var id = ($('#editable3').find("tr").length+1);
                $('#editable3').dataTable().fnAddData([
                "<a href='#' id='btncmdkey" +id+ "'data-type='text' data-title='设置键'>设置键</a>",
                "<a href='#' id='btncmdval" +id+ "'data-type='text' data-title='设置值'>设置值</a>",
                "<a href='#' id='btncmdact" +id+ "'>选择动作</a>"
                ]);
                edit_enable(id,3);
            }
            else if(num == 4){
                var id = ($('#editable4').find("tr").length+1);
                $('#editable4').dataTable().fnAddData([
                "<a href='#' id='takcmdkey" +id+ "'data-type='text' data-title='设置键'>设置键</a>",
                "<a href='#' id='takcmdval" +id+ "'data-type='text' data-title='设置值'>设置值</a>",
                "<a href='#' id='takcmdact" +id+ "'>选择动作</a>"
                ]);
                edit_enable(id,4);
            }
            else if(num == 5){
                var id = ($('#editable5').find("tr").length+1);
                $('#editable5').dataTable().fnAddData([
                "<a href='#' id='plycmdkey" +id+ "'data-type='text' data-title='设置键'>设置键</a>",
                "<a href='#' id='plycmdval" +id+ "'data-type='text' data-title='设置值'>设置值</a>",
                "<a href='#' id='plycmdact" +id+ "'>选择动作</a>"
                ]);
                edit_enable(id,5);
            }
            else if(num == 6){
                var id = ($('#editable6').find("tr").length+1);
                $('#editable6').dataTable().fnAddData([
                "<a href='#' id='chtcmdkey" +id+ "'data-type='text' data-title='设置键'>设置键</a>",
                "<a href='#' id='chtcmdval" +id+ "'data-type='text' data-title='设置值'>设置值</a>",
                "<a href='#' id='chtcmdact" +id+ "'>选择动作</a>"
                ]);
                edit_enable(id,6);
            }
            else if(num == 7){
                var id = ($('#editable7').find("tr").length+1);
                $('#editable7').dataTable().fnAddData([
                "<a href='#' id='timcmdkey" +id+ "'data-type='text' data-title='设置键'>设置键</a>",
                "<a href='#' id='timcmdval" +id+ "'data-type='text' data-title='设置值'>设置值</a>",
                "<a href='#' id='timcmdact" +id+ "'>选择动作</a>"
                ]);
                edit_enable(id,7);
            }
    
        }




        function msg_show(txt){
            bootbox.alert(txt);
        }

        //显示删除
        function delete_modal(){
            var rows = $("#exampleTableEvents").bootstrapTable('getSelections', function (row) {
                return row;
            });
            if(rows.length == 0)
            {
                msg_show('至少选择一项');
                return false;
            }        
            var namelist = "是否要删除应用：";
            for (var i = 0; i < rows.length; i++) {  
                namelist +=  "<" + rows[i].id + ">" + rows[i].name+"\n";
            } 
            //msg_show(namelist);
            $("#delete_text").text(namelist);
            $('#delete-modal').modal('show');
        }

        //显示编辑
        function edit_modal(){
            var rows = $("#exampleTableEvents").bootstrapTable('getSelections', function (row) {
                return row;
            });
            if(rows.length == 1)
            {
                $('#edit_title').val(rows[0].title);
                $('#edit_iom').val(rows[0].io_m);
                $('#edit_cmt').val(rows[0].customer);
                $('#edit_path').val(rows[0].path);
                $('#edit-modal').modal('show');
                return true;
                
            }else if(rows.length == 2){
                if(rows[0].id == "ID"){
                    msg_show("选中了两行");
                    $('#edit_title').val(rows[0].name);
                    $('#edit_iom').val(rows[0].io_m);
                    $('#edit_cmt').val(rows[0].customer);
                    $('#edit_path').val(rows[0].path);
                    $('#edit-modal').modal('show');
                    return true;
                }
            }
            msg_show("只能选择一项进行编辑!");
            return false;
        }

        // 删除表单
        function delete_info(){
            var rows = $("#exampleTableEvents").bootstrapTable('getSelections', function (row) {
                return row;
            });
            if(rows.length == 0)
            {
                alert('Error！');
                return false;
            }        
            var _list =[];
            for (var i = 0; i < rows.length; i++) {  
                _list[i] = rows[i].id; 
            }          
            $.ajax({
                url: "/bag/delete",
                data:{"ids":_list},
                type: "post",
                success:function(data)
                {
                    if(data =="ok")
                    {
                        msg_show('操作成功');
                         location.reload();
                    }
                    else
                    {
                        msg_show('操作失败');
                    }
                },
                error:function()
                {
                    msg_show('请求出错');
                }
            });

            return false;
        }

        // 编辑表单
        function edit_info(){
            var rows = $("#exampleTableEvents").bootstrapTable('getSelections', function (row) {
                return row;
            });
            if(rows.length != 1)
            {
                alert("编辑应用只能单选！！！");
                return false;
            }
            var id = rows[0].id;
            var title = $('#edit_title').val();
            var iom = $('#edit_iom').val();
            var customer = $('#edit_cmt').val();
            var pathstr = $('#edit_path').val();         
            msg_show("提交id" +id+ "--过去文件:" +oldfile+ "--文件名称:" + name);
            $.ajax({
                url: "/module/edit",
                data: {"id":id,"title":title,"iom":iom,"customer":customer,"path":pathstr},
                type: "post",
                success:function(data)
                {
                    if(data == "ok")
                    {
                        msg_show("提交成功");
                        
                        location.reload();
                    }
                    else
                    {
                        msg_show('操作失败');
                    }
                },
                error:function()
                {
                    msg_show('请求出错');
                }
            });

            return false;
        }

       

        // 提交表单
        function check_form(){
            var tab_id = $("#style_id").html();
            var title="";
            var pathstr="";
            var bag="";
            var type="";
            var iom="";
            var customer = "";
            var tabkey=[];
            var tabval=[];
            var tabact=[];
            var title=$("#add_title").val();
            if(tab_id==1){
                bag = $('#baglist1').val();
                pathstr = $('#path1').val();
                type="";
                iom = $('#iomname1').val();
                customer = $('#cmtlist1').val();
                var id = ($('#editable1').find("tr").length);
                for(var i=1;i<id;i++){
                    var key = '#iocmdkey'+i;
                    var val = '#iocmdval'+i;
                    var act = '#iocmdact'+i;
                    tabkey[i-1] = $(key).editable('getValue', true);
                    tabval[i-1] = $(val).editable('getValue', true);
                    tabact[i-1] = $(act).editable('getValue', true);
                    msg_show("upload");
                }
            }else if(tab_id==2){
                bag = $('#baglist2').val();
                pathstr = $('#path2').val();
                type= $('#typelist2').val();
                iom = $('#iomname2').val();
                customer = $('#cmtlist2').val();
                var id = ($('#editable2').find("tr").length);
                for(var i=1;i<id;i++){
                    var key = '#sldcmdkey'+i;
                    var val = '#sldcmdval'+i;
                    var act = '#sldcmdact'+i;
                    tabkey[i-1] = $(key).editable('getValue', true);
                    tabval[i-1] = $(val).editable('getValue', true);
                    tabact[i-1] = $(act).editable('getValue', true);
                }

            }else if(tab_id==3){
                bag = $('#baglist3').val();
                pathstr = $('#path3').val();
                type="";
                iom = $('#iomname3').val();
                customer = $('#cmtlist3').val();
                var id = ($('#editable3').find("tr").length);
                for(var i=1;i<id;i++){
                    var key = '#btncmdkey'+i;
                    var val = '#btncmdval'+i;
                    var act = '#btncmdact'+i;
                    tabkey[i-1] = $(key).editable('getValue', true);
                    tabval[i-1] = $(val).editable('getValue', true);
                    tabact[i-1] = $(act).editable('getValue', true);
                }
                
            }else if(tab_id==7){
                bag = $('#baglist4').val();
                pathstr = $('#path4').val();
                type="";
                iom = $('#iomname4').val();
                customer = $('#cmtlist4').val();
                var id = ($('#editable4').find("tr").length);
                for(var i=1;i<id;i++){
                    var key = '#takcmdkey'+i;
                    var val = '#takcmdval'+i;
                    var act = '#takcmdact'+i;
                    tabkey[i-1] = $(key).editable('getValue', true);
                    tabval[i-1] = $(val).editable('getValue', true);
                    tabact[i-1] = $(act).editable('getValue', true);
                }
                
            }else if(tab_id==5){
                bag = $('#baglist5').val();
                pathstr = $('#path5').val();
                type=$('#typelist5').val();
                iom = $('#iomname5').val();
                customer = $('#cmtlist5').val();
                var id = ($('#editable5').find("tr").length);
                for(var i=1;i<id;i++){
                    var key = '#plycmdkey'+i;
                    var val = '#plycmdval'+i;
                    var act = '#plycmdact'+i;
                    tabkey[i-1] = $(key).editable('getValue', true);
                    tabval[i-1] = $(val).editable('getValue', true);
                    tabact[i-1] = $(act).editable('getValue', true);
                }
                
            }else if(tab_id==6){
                bag = $('#baglist6').val();
                pathstr = $('#path6').val();
                type=$('#typelist6').val();
                iom = $('#iomname6').val();
                customer = $('#cmtlist6').val();
                var id = ($('#editable6').find("tr").length);
                for(var i=1;i<id;i++){
                    var key = '#chtcmdkey'+i;
                    var val = '#chtcmdval'+i;
                    var act = '#chtcmdact'+i;
                    tabkey[i-1] = $(key).editable('getValue', true);
                    tabval[i-1] = $(val).editable('getValue', true);
                    tabact[i-1] = $(act).editable('getValue', true);
                }
                
            }else if(tab_id==4){
                bag = $('#baglist7').val();
                pathstr = $('#path7').val();
                type=$('#typelist7').val();
                iom = $('#iomname7').val();
                customer = $('#cmtlist7').val();
                var id = ($('#editable7').find("tr").length);
                for(var i=1;i<id;i++){
                    var key = '#timcmdkey'+i;
                    var val = '#timcmdval'+i;
                    var act = '#timcmdact'+i;
                    tabkey[i-1] = $(key).editable('getValue', true);
                    tabval[i-1] = $(val).editable('getValue', true);
                    tabact[i-1] = $(act).editable('getValue', true);
                }
                
            }
            $.ajax({
                url: "/module/add",
                data: {"bag":bag,"path":pathstr,"title":title,"type":type,"iom":iom,"customer":customer,"style":tab_id,"tabkey":tabkey,"tabval":tabval,"tabact":tabact},
                type: "post",
                success:function(data)
                {
                    if(data == "ok")
                    {
                        msg_show("提交成功");
                        
                        location.reload();
                    }
                    else
                    {
                        switch(data){
                            case "error0":msg_show('请选择正确的动作');break;
                            case "error1":msg_show('开关模块错误');break;
                            case "error2":msg_show('输入正确的键值');break;
                            case "error3":msg_show('请填写完整内容');break;
                            case "error4":msg_show('填写正确路径');break;
                            case "error5":msg_show('填写正确的应用');break;
                            case "error6":msg_show('操作失败');break;
                            default:break;
                        }
                        msg_show('操作失败');
                    }
                },
                error:function()
                {
                    msg_show('请求出错');
                }
            });

            return false;
        }
    </script>

</body>

</html>
